//
// Decompiled by Jadx - 366ms
//
package fp;

import android.os.Handler;
import android.os.Looper;
import de.robv.android.xposed.XposedHelpers;
import fn.j;
import fn.x;
import fn.y;
import java.util.ArrayList;
import java.util.List;
import o.a;

@a("DY")
public final class ab extends x {
    public static aa cp;
    public static Handler cq;
    public static int cr;

    public static void cs() {
        int i;
        Handler handler;
        Runnable runnable = cp;
        if (runnable != null && (handler = cq) != null) {
            handler.removeCallbacks(runnable);
            cp = null;
        }
        if (j.ae("auto_play") && cr == 68) {
            List list = (List) XposedHelpers.getObjectField(y.by.getAweme(), "images");
            if (list == null || list.isEmpty()) {
                i = 10000;
            } else if (list.size() < 3) {
                return;
            } else {
                i = list.size() * 3 * 1000;
            }
            Handler handler2 = new Handler(Looper.getMainLooper());
            cq = handler2;
            aa aaVar = new aa(0);
            cp = aaVar;
            handler2.postDelayed(aaVar, i);
        }
    }

    public static void ct(Object obj) {
        List list;
        if (j.ae("DownLimit") && obj != null) {
            Object objectField = XposedHelpers.getObjectField(obj, "videoControl");
            if (objectField != null) {
                Boolean bool = Boolean.TRUE;
                XposedHelpers.setObjectField(objectField, "downloadIgnoreVisibility", bool);
                XposedHelpers.setObjectField(objectField, "allowDownload", bool);
                XposedHelpers.setIntField(objectField, "preventDownloadType", 0);
            }
            XposedHelpers.setObjectField(obj, "awemeRiskModel", (Object) null);
            XposedHelpers.setBooleanField(obj, "isLiveReplay", false);
            XposedHelpers.setIntField(obj, "isMeteor", 0);
            if (XposedHelpers.getIntField(obj, "awemeType") == 117) {
                XposedHelpers.setIntField(obj, "awemeType", 0);
            }
            Object objectField2 = XposedHelpers.getObjectField(obj, "status");
            if (objectField2 != null) {
                XposedHelpers.setIntField(objectField2, "reviewed", 1);
                XposedHelpers.setIntField(objectField2, "downloadStatus", 0);
            }
        }
        if (!j.ae("DownImage") || obj == null || XposedHelpers.getIntField(obj, "awemeType") != 68 || (list = (List) XposedHelpers.getObjectField(obj, "images")) == null || list.isEmpty()) {
            return;
        }
        for (Object obj2 : list) {
            List list2 = (List) XposedHelpers.getObjectField(obj2, "urlList");
            if (list2 != null) {
                ArrayList arrayList = new ArrayList(list2);
                if (!arrayList.isEmpty()) {
                    XposedHelpers.setObjectField(obj2, "downloadUrlList", arrayList);
                }
            }
        }
    }

    public final void a() {
        j.bd("com.ss.android.ugc.aweme.feed.adapter.VideoViewHolder", "getAweme", new Object[]{new a()});
        j.bd("com.ss.android.ugc.aweme.feed.adapter.VideoViewHolder", "LIZ", new Object[]{Long.class, new b()});
        j.bd("com.ss.android.ugc.aweme.feed.adapter.VideoViewHolder", "onPageSelected", new Object[]{new c()});
        j.bd("com.ss.android.ugc.aweme.feed.share.video.SharePrivacyVideoApi$PrivacyVideoResponse", "getStatus", new Object[]{new d()});
    }
}
